using System;

namespace BoxBinary.AspectCache.Core.Helpers
{
    /// <summary>
    /// Event arguments for when an exception has occurred.
    /// </summary>
    public sealed class ExceptionEventArgs : EventArgs
    {
        #region Instance Variables

        #endregion

        #region Properties

        /// <summary>
        /// The actual exception that occurred.
        /// </summary>
        public Exception Exception { get; set; }

        #endregion

        #region Constructors

        /// <summary>
        /// Construct an exception event argument based on the supplied exception.
        /// </summary>
        /// <param name="exception">The exception that occurred.</param>
        public ExceptionEventArgs(Exception exception)
        {
            #region Validate

            // Validate the parameters are valid
            if (exception == null)
                throw new ArgumentNullException("exception");

            #endregion

            // Set the exception
            Exception = exception;
        }

        #endregion
    }
}